package com.groupbuying.redpacket.dao;

import com.groupbuying.redpacket.domain.RedPacketTaskDO;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.groupbuying.redpacket.dto.RedPacketTaskDTO;
import com.groupbuying.redpacket.dto.RedPacketTaskVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 红包任务表
 * @author vincnetxin
 * @email vincentxin@aliyun.com
 * @date 2019-11-12 14:54:23
 * @des
 */

@Mapper
@Repository
public interface RedPacketTaskDao {

	RedPacketTaskDO get(Long id);
	
	List<RedPacketTaskDO> list(Map<String, Object> map);
	
	int count(Map<String, Object> map);
	
	int save(RedPacketTaskDO redPacketTask);
	
	int update(RedPacketTaskDO redPacketTask);
	
	int remove(Long id);
	
	int batchRemove(Long[] ids);

	int getCount();

	List<RedPacketTaskDO> contrastTime(@Param("id") Long id);
	/**
	 * @MethodName: findCriticalValueTaskInfo
	 * @Description: TODO	查找在临界值内的任务信息
	 * @param nowTime	当前系统时间
	 * @param startTimeRange	开始时间范围
	 * @param endTimeRange	结束时间范围
	 * @Return: java.util.List<com.groupbuying.redpacket.domain.RedPacketTaskDO>
	 * @Author: srlg3
	 * @Date: 2019/11/21
	 */
	RedPacketTaskDO findCriticalValueTaskInfo(@Param("nowTime") Date nowTime,
											  @Param("startTimeRange") Integer startTimeRange, @Param("endTimeRange") Integer endTimeRange);

	List<RedPacketTaskVo> listTask(Map<String,Object> map);

	RedPacketTaskDTO getTask(Long id);

	RedPacketTaskDO getAppFlag(String appFlag,int round);
}
